#include "Randomizer.hh"
#include <iostream>
#include "Bug.h"

Bug bug("test");
#ifdef DEBUG
int DEBUGTracker::depth = 1;
#endif
  
double identity(double x)
{
  return x;
}
  
int main(void)
{
  
  std::vector<double> options;
  
  while(!std::cin.eof())
    {
      double w;
      std::cin >> w;
      if(!std::cin.eof()) options.push_back(w);
    }
  
  std::cerr << "options: " << options.size() << std::endl;
  
  
  for(unsigned n=0; n!=1000000; ++n)
    {
      unsigned action = randomized_selection(options.begin(), options.end()) 
	- options.begin();

      std::cout << "selected action: " << action << " weight: " 
		<< options[action]
		<< std::endl;
    }
  
  return 0;
}
